<template>
  <el-form :model="model" :rules="rules" ref="elForm" v-bind="$attrs" v-on="$listeners">
    <slot></slot>
  </el-form>
</template>
<script>
export default {
  name: 'BaseForm',
  props: { model: Object, rules: Object },
  methods: {
    triggerValidate() {
      this.$refs.elForm.validate(valid => {
        this.$emit('validated', valid);
      });
    },
    resetFields() {
      this.$refs.elForm.resetFields();
    },
    validate(callback) {
      this.$refs.elForm.validate(callback);
    }
  }
}
</script> 